Skip to content

Conversation

@ada4a
Copy link
Contributor

@ada4a ada4a commented Sep 7, 2025

The last change might be deemed a bit too much for the feature freeze, but it can be easily extracted out into a separate PR.

changelog: [mutex_atomic]: only lint the definitions, not uses
changelog: [mutex_atomic]: better help messages, and suggestions
changelog: [mutex_atomic]: don't lint Mutex<*const T>
changelog: [mutex_integer]: only lint the definitions, not uses
changelog: [mutex_integer]: better help messages, and suggestions

@rustbot
Copy link
Collaborator

rustbot commented Sep 7, 2025

r? @llogiq

rustbot has assigned @llogiq.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Sep 7, 2025
@github-actions
Copy link

github-actions bot commented Sep 7, 2025

Lintcheck changes for 778da58

Lint Added Removed Changed
clippy::mutex_atomic 0 14 0

This comment will be updated if you push new changes

@ada4a
Copy link
Contributor Author

ada4a commented Sep 7, 2025

Oh, looking at Lintcheck, I'll also need to (re-)add a check_field_def

EDIT: Although that wasn't actually linted before -- what Lintcheck shows is the mutex being created for a struct constructor, but that's arguably another instance of linting use, not declaration, so linting on field definitions would be a nice addition, but probably best left to after the feature freeze

@ada4a ada4a marked this pull request as draft September 7, 2025 23:53
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Sep 7, 2025
@ada4a ada4a marked this pull request as ready for review September 8, 2025 17:38
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Sep 8, 2025
@rustbot

This comment has been minimized.

ada4a added 6 commits October 11, 2025 10:34
- The main message should point out what's wrong, not directly suggest a
  solution.
- The second part of the message is a separate advice, so it should be
  emitted separately.
`Mutex<*const _>` doesn't make a lot of sense (there can be no
contention over a read-only reference), but `AtomicPtr::new(*const _)`
straight up doesn't compile
@rustbot
Copy link
Collaborator

rustbot commented Oct 11, 2025

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@llogiq
Copy link
Contributor

llogiq commented Oct 15, 2025

When I saw the lines added, I thought I'd be in for a longer review, but laudably most of the lines are in tests added. So this looks good to me. Thanks!

@llogiq llogiq added this pull request to the merge queue Oct 15, 2025
Merged via the queue into rust-lang:master with commit 8697533 Oct 15, 2025
11 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Oct 15, 2025
@ada4a ada4a deleted the mutex_atomic branch October 16, 2025 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

clippy::mutex_integer lints on uses of Mutex<{integer}>, not just definitions

3 participants